#!/bin/bash

s=0
b=$((128*1024))
e=$b

for j in {1..8}; do
  > cl256K_APP$j
  for i in $(eval echo {$s..$e}); do
    printf -v ID "c%08d" $i
    printf ${ID}"|1|"${ID}"|svtpvtpass|1:0:/APP/$j/CAR/"${ID}"||\n" >> cl256K_APP$j
  done
  echo $s..$e
  s=$(($e+1))
  e=$(($e+$b))
done

cat cl256K_APP1 cl256K_APP2 > cl256K_APP12
cat cl256K_APP3 cl256K_APP4 > cl256K_APP34
cat cl256K_APP5 cl256K_APP6 > cl256K_APP56
cat cl256K_APP7 cl256K_APP8 > cl256K_APP78
